import os
import shutil
from setuptools import setup
from setuptools.command.install import install as baseInstall
class installer(baseInstall):

  def run(self):
    globalsPath = os.path.join(os.path.expanduser('~'),'.pybythecGlobals.json')
    print('installing ' + globalsPath)
    shutil.copy2(os.path.join(os.getcwd(), 'globals.json'), globalsPath)
    baseInstall.run(self)

description = 'A lightweight cross-platform build system for c/c++, written in python'
with open('README.rst', 'r') as file:
  long_description = str(file.read()).replace(description, '')

setup(
    name = 'pybythec',
    version = '0.9.65',
    author = 'zhengankun',
    author_email = 'zhengankun@163.com',
    url = 'https://gitee.com/zhengankun/pybythec',
    description = description,
    long_description = long_description,
    packages = ['pybythec'],
    entry_points = {
        'console_scripts': ['pybythec=pybythec.command_line:main'],
    },
    install_requires = ['commentjson'],
    license = 'LICENSE',
    test_suite = 'test',
    cmdclass = {'install': installer}
)
